import plotly as py
import plotly.graph_objs as go
import ssl

ssl._create_default_https_context = ssl._create_unverified_context

# 设置用户名和访问API Key
py.tools.set_credentials_file(username='Mory',api_key='tnPhCJMGo91fK47mYcMS')

import plotly.figure_factory as ff
import pandas as pd

df = pd.read_csv("https://raw.githubusercontent.com/plotly/datasets/master/school_earnings.csv")

data = [go.Bar(x=df.School,
            y=df.Gap)]

py.plotly.plot(data)
